package com.kinyx.framework.security;

import java.io.FileInputStream;
import java.io.IOException;

import org.junit.Assert;
import org.junit.Test;

import com.kinyx.framework.file.KPathUtils;

public class KMD5_Tester_ {

	@Test
	public void test() throws IOException {
		Assert.assertEquals("e5bcb85c2e2a5178aa4a628482b5a41c", KMD5.encrypt("kinyx", null, null));
		Assert.assertEquals("e5bcb85c2e2a5178aa4a628482b5a41c", KMD5.encrypt(new FileInputStream(KPathUtils.resources(true) + "/file/md5/kinyx.md5")));

		Assert.assertEquals("c4ca4238a0b923820dcc509a6f75849b", KMD5.encrypt("1", null, null));
		Assert.assertEquals("c4ca4238a0b923820dcc509a6f75849b", KMD5.encrypt(new FileInputStream(KPathUtils.resources(true) + "/file/md5/test.md5")));
	}

}
